
package com.zsrt.day20170427.ch01;


import java.lang.reflect.Constructor;

import org.junit.Test;

public class ConstructorTest {

	@Test
	public void test01() throws Exception {
		
		//调用带参的构造方法
		Class clazz = Class.forName("com.zsrt.day20170427.ch01.Student");
		
		//形参
		Constructor constructor = clazz.getConstructor(String.class,int.class);
		
		//实参
		Object object = constructor.newInstance("王五",22);
		
		System.out.println(object);
	}
}
